#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct Stu
{
  int no;
  double a, b, c;
  char name[25];
  struct Stu *next;
}stu;
void creat(stu *p, int n);
void prt(stu *p);

int main()
{
  stu *h;
  int n,num;
  h = (stu *)malloc(sizeof(stu));//头指针
  //h = new stu;//头指针
  h->next=NULL;
  while(~scanf("%d",&n))
  {
      creat(h, n);
      prt(h);
  }
  return 0;
}

void  creat(stu *p,int n)
{ 
  stu *q,*r=p;//q创结点，r串结点
  int i;
  for(i=0;i<n;i++)
  {     
      q=(stu *)malloc(sizeof(stu));
      //q = new stu;
      scanf("%d  %s  %lf  %lf  %lf", &q->no, q->name, &q->a, &q->b, &q->c);
      r->next = q;
      r = q;
  }
  r->next=NULL;
}
void  prt(stu *p)
{
    stu *q;
    q = p->next;
      while(q!=NULL)
      {
          printf("%d  %s  %.2lf  %.2lf  %.2lf  ", q->no, q->name, q->a, q->b, q->c);
          printf("%.2lf  %.2lf\n",(q->a+q->b+q->c)/3.0,q->a+q->b+q->c);
          q = q->next;
      }
}


/*
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct Student
{
  int sno;
  char name[20];
  float score[3];
  float ave;
  float sum;
}STU;
typedef struct node
{
  STU  data;
  struct node *next;
}SNode;

int main()
{
  void input(SNode *p);//每个结点的输入
  void CreateList1(SNode *H, int n);// 头结点H后面创建包含n个元素的链表,尾插法
  void output(SNode *H);//输出H后的结点
  SNode *H;
  int n;
  while(scanf("%d",&n)!=EOF)
   {
     H= (SNode*)malloc(sizeof(SNode)); H->next=NULL;
     CreateList1(H,n);
     output(H);
    }
    return 0;
}

void input(SNode  *p)
{
  char xm[20];
  int xh,i;
  double fs[4];
  scanf("%d%s",&xh,xm);
  p->data.sno=xh;strcpy(p->data.name,xm);p->data.sum=0;
  for(i=0;i<=2;i++)
    {
      scanf("%lf",&fs[i]); p->data.score[i]=fs[i];
      p->data.sum= p->data.sum+ fs[i];
    }
   p->data.ave= p->data.sum/3;
}

void  CreateList1(SNode*H,int n)
{ SNode *p,*r=H;//p创结点，r串结点
  int i;
  for(i=0;i<n;i++)
  {     p=(SNode*)malloc(sizeof(SNode));
        input(p);
        r->next=p;r=p;
  }
  r->next=NULL;
}

void output(SNode *H)
{   int j;
    SNode *p;
    p=H->next;
    while(p!=NULL)
     {  printf("%d  %s  ",p->data.sno,p->data.name);
        for(j=0;j<3;j++)
            printf("%.2f  ",p->data.score[j]);
        printf("%.2f  %.2f\n",p->data.ave,p->data.sum);
        p=p->next;
     }
}
*/